﻿<extend name="../Public/base" />
<block name="title">{$TITLE}列表</block>
<block name="body">
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
            <a href="javascript:;" onclick="dels('ad_id')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
            <a href="javascript:;" onclick="layer_show('添加{$TITLE}','{:U("add")}','800','480')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加</a>
        </span>
    </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-bg">
            <thead>
            <tr class="text-c">
                <th width="5%"><input type="checkbox" name="" value=""></th>
                <th width="10%">ID</th>
                <th width="20%">{$TITLE}名称</th>
                <th width="35%">调用代码</th>
                <th width="5%">状态</th>
                <th width="30%">操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="list" id="info">
                <tr class="text-c">
                    <td><input type="checkbox" name="ad_id[]" value="{$info.ad_id}"></td>
                    <td>{$info.ad_id}</td>
                    <td>{$info.ad_name}</td>
                    <php>$ad_code="{".":x_get_ad('".$info['ad_name']."')}";</php>
                    <td>{$ad_code}</td>
                    <td>
                        <eq name='info.status' value='1'>
                            <span class="label label-success radius">已启用</span>
                            <else/>
                            <span class="label radius">已停用</span>
                        </eq>
                    </td>
                    <td class="f-14">
                        <eq name='info.status' value='1'>
                            <a  onclick="change_status('{$info.ad_id}')" href="javascript:;" title="显示"><i class="Hui-iconfont">&#xe631;</i></a>
                            <else/>
                            <a  onclick="change_status('{$info.ad_id}')" href="javascript:;" title="不显示"><i class="Hui-iconfont">&#xe615;</i></a>
                        </eq>
                        <a title="编辑" href="javascript:;" onclick="layer_show('编辑{$TITLE}','{:U('edit',array('ad_id'=>$info['ad_id']))}','800','480')" class="ml-5">
                            <i class="Hui-iconfont">&#xe6df;</i>
                        </a>
                        <a title="删除" href="javascript:;" onclick="del('{$info.ad_id}','ad_id')" class="ml-5">
                            <i class="Hui-iconfont">&#xe6e2;</i>
                        </a>
                    </td>
                </tr>
            </volist>
            </tbody>
        </table>
    </div>
    <div class='paging_simple_numbers'>{$page}</div>
</block>
<block name="js">
    <script type="text/javascript">
        function change_status(id) {
            action('确认要改变状态吗？',id,"{:U('changeStatus')}",'ad_id');
        }
    </script>
</block>